export default app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const investmentDirection = app.model.define('investment_direction', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    uuid: { type: STRING(36), unique: true },
    name: STRING(10), // 投资方向
    createdAt: DATE,
    updatedAt: DATE,
  });
  investmentDirection.associate = () => {
    app.model.InvestmentDirection.belongsToMany(app.model.Organization, {
      through: app.model.MergeOrganizationInvestment,
      foreignKey: 'investment_id',
      otherKey: 'organization_id',
    });
  };
  return investmentDirection;
};
